// 父类，用于跟踪错误等
// by indraw 2013.02.11
package bbs

import (
    "errors"
    "utils/mgo"
	//"reflect"

)

//设置错误
type Dao struct {
    s    []string // 错误描述
    c   *mgo.Collection
}

/**
 * 记录错误
 *
 * author: indraw
 * date: 2013-02-11
 */
func (d *Dao) newError(str string) error  { 
    d.s = append(d.s, str)
    err := errors.New(str)
    return err
}

/**
 * 判断错误
 *
 * author: indraw
 * date: 2013-02-11
 */
func (d *Dao) ckError() error {
    sl := len(d.s)
    if sl > 0 {
        err := errors.New(d.s[0])
        return err
    }
    return nil
    
}
